package cn.edu.ujn.shi.service;

import cn.edu.ujn.shi.dao.LoginLog;
import cn.edu.ujn.shi.dao.LoginLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: LC
 * @date 2024-05-31 06:53
 * @ClassName: LoginLogServiceImpl
 */
@Service
public class LoginLogServiceImpl implements ILoginLogService {

    @Autowired
    private LoginLogMapper loginLogMapper;

    @Override
    public List<LoginLog> getLoginLog(String username) {
        if (username == null) {
            username = "";
        }
        return loginLogMapper.getLoginLog(username);
    }

    @Override
    public List<LoginLog> getAll() {
        return loginLogMapper.getAll();
    }

    @Override
    public void insert(LoginLog loginLog) {
        loginLogMapper.insert(loginLog);
    }

    @Override
    public void delete(int id) {
        loginLogMapper.delete(id);
    }
}
